#include<iostream>
#include<pthread.h>

using namespace std;

void* start_routine(void* args)
{
    long long * num=static_cast<long long*>(args);
    pthread_mutex_t mut;
    pthread_mutex_init(&mut,nullptr);//初始化锁
    pthread_mutex_lock(&mut);//加锁
    pthread_mutex_lock(&mut);//二次加锁
    cout<<"加锁的数据是num: "<<*num<<endl;
    pthread_mutex_unlock(&mut);//解锁

    return nullptr;

}

int main()
{
    pthread_t t1;
    long long num=199;
    pthread_create(&t1,nullptr,start_routine,(void*)num);

    pthread_join(t1,nullptr);
    return 0;
}